home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gnumake / pdmake.zoo / h.h < prev    next >
C/C++ Source or Header  |  1991-09-25  |  4KB  |  224 lines

  1.     /***************************************************************\
  2.     *                                *
  3.     *  PDMAKE, Atari ST version                    *
  4.     *                                *
  5.     *  Adapted from mod.sources Vol 7 Issue 71, 1986-12-03.        *
  6.     *                                *
  7.     *  This port makes extensive use of the original net.sources    *
  8.     *  port by Jwahar Bammi.                    *
  9.     *                                *
  10.     *      Ton van Overbeek                        *
  11.     *      Email: TPC862@ESTEC.BITNET                *
  12.     *             TPC862%ESTEC.BITNET@WISCVM.WISC.EDU    (ARPA)    *
  13.     *             ...!mcvax!tpc862%estec.bitnet   (UUCP Europe)    *
  14.     *             ...!ucbvax!tpc862%estec.bitnet  (UUCP U.S.A.)    *
  15.     *             71450,3537  (CompuServe)                *
  16.     *                                *
  17.     \***************************************************************/
  18.  
  19. /*
  20.  *    Include header for make
  21.  */
  22.  
  23.  
  24. #ifdef atarist
  25. #ifndef ATARIST
  26. #define ATARIST
  27. #endif
  28. #endif
  29.  
  30. #ifdef ATARIST
  31.  
  32. #include <osbind.h>
  33. #ifndef __GNUC__
  34. #include "decl.h"
  35. #else
  36. #include <stddef.h>
  37. #include <stdlib.h>
  38. #include <unistd.h>
  39. #include <string.h>
  40. #include <stdio.h>
  41. #include <memory.h>
  42. #include <errno.h>
  43. #endif
  44.  
  45. /* #define MEGRULES    */    /* Define if default .c.o rule is to be
  46.                  * generated to use the Megamax C Compiler
  47.                  */
  48.  
  49. /* #define MEGAMAX    */    /* If using Megamax C to compile Make
  50.                  * This symbol has NO relation to the
  51.                  * symbol MEGRULES
  52.                  */
  53.  
  54. #ifdef MEGAMAX
  55. #undef Fdatime            /* Megamax has it incorrectly defined */
  56. #define Fdatime(a,b,c)    gemdos(0x57,a,b,c)
  57. #endif /* MEGAMAX */
  58.  
  59. #ifdef TRUE
  60. #undef TRUE
  61. #endif
  62.  
  63. #ifdef FALSE
  64. #undef FALSE
  65. #endif
  66.  
  67. #ifdef uchar
  68. #undef uchar
  69. #endif
  70.  
  71. #ifdef NULL
  72. #undef NULL
  73. #endif
  74. #define NULL    0L
  75.  
  76. #ifdef max
  77. #undef max
  78. #endif
  79.  
  80. #endif /* ATARIST */
  81.  
  82. #ifndef uchar
  83. #ifdef os9
  84. #define uchar    char
  85. #define void    int
  86. #define fputc    putc
  87. #endif
  88. #ifdef ATARIST
  89. #define uchar    char
  90. #ifndef __GNUC__
  91. #define void    int
  92. #endif
  93. #define time Time
  94. #endif
  95. #ifndef uchar
  96. #define uchar    unsigned char
  97. #endif
  98. #endif
  99.  
  100. #define bool        uchar
  101. #ifndef time_t
  102. #define time_t        long
  103. #endif
  104. #define TRUE        (1)
  105. #define FALSE        (0)
  106. #define max(a,b)    ((a)>(b)?(a):(b))
  107.  
  108. #define DEFN1    "makefile"        /*  Default names  */
  109. #ifdef unix
  110. #define DEFN2    "Makefile"
  111. #endif
  112. #ifdef eon
  113. #define DEFN2    "Makefile"
  114. #endif
  115. #ifdef __GNUC__
  116. #define DEFN2    "Makefile"
  117. #endif
  118. /* os9 and Atari ST are case insensitive */
  119.  
  120. #define LZ    (1024)            /*  Line size  */
  121.  
  122.  
  123.  
  124. /*
  125.  *    A name.  This represents a file, either to be made, or existant
  126.  */
  127.  
  128. struct name
  129. {
  130.     struct name *    n_next;        /* Next in the list of names */
  131.     char *        n_name;        /* Called */
  132.     struct line *    n_line;        /* Dependencies */
  133.     time_t        n_time;        /* Modify time of this name */
  134.     uchar        n_flag;        /* Info about the name */
  135. };
  136.  
  137. #define N_MARK        0x01        /* For cycle check */
  138. #define N_DONE        0x02        /* Name looked at */
  139. #define N_TARG        0x04        /* Name is a target */
  140. #define N_PREC        0x08        /* Target is precious */
  141. #define N_DOUBLE    0x10        /* Double colon target */
  142.  
  143. /*
  144.  *    Definition of a target line.
  145.  */
  146. struct line
  147. {
  148.     struct line *    l_next;        /* Next line (for ::) */
  149.     struct depend *    l_dep;        /* Dependents for this line */
  150.     struct cmd *    l_cmd;        /* Commands for this line */
  151. };
  152.  
  153.  
  154. /*
  155.  *    List of dependents for a line
  156.  */
  157. struct depend
  158. {
  159.     struct depend *    d_next;        /* Next dependent */
  160.     struct name *    d_name;        /* Name of dependent */
  161. };
  162.  
  163.  
  164. /*
  165.  *    Commands for a line
  166.  */
  167. struct cmd
  168. {
  169.     struct cmd *    c_next;        /* Next command line */
  170.     char *        c_cmd;        /* Command line */
  171. };
  172.  
  173.  
  174. /*
  175.  *    Macro storage
  176.  */
  177. struct macro
  178. {
  179.     struct macro *    m_next;        /* Next variable */
  180.     char *        m_name;        /* Called ... */
  181.     char *        m_val;        /* Its value */
  182.     uchar        m_flag;        /* Infinite loop check */
  183. };
  184.  
  185. #include "proto.h"
  186.  
  187. extern char *        myname;
  188. extern struct name    namehead;
  189. extern struct macro *    macrohead;
  190. extern struct name *    firstname;
  191. extern bool    silent;
  192. extern bool    ignore;
  193. extern bool    rules;
  194. extern bool    dotouch;
  195. extern bool    quest;
  196. extern bool    domake;
  197. extern char    str1[];
  198. extern char    str2[];
  199. extern int    lineno;
  200.  
  201. #ifndef __GNUC__
  202. char *        fgets();
  203. char *        index();
  204. char *        rindex();
  205. char *        malloc();
  206. extern int    errno;
  207. #endif
  208.  
  209. char *        getmacro();
  210. struct macro *    setmacro();
  211. void        input();
  212. void        error();
  213. void        fatal();
  214. int        make();
  215. struct name *        newname();
  216. struct depend *        newdep();
  217. struct cmd *        newcmd();
  218. void        newline();
  219. char *        suffix();
  220. void        touch();
  221. void        makerules();
  222. char *        gettok();
  223. void        precious();
  224.